home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / dev / gui / gtlayout.lha / Source / LTP_DrawBackFore.c < prev    next >
C/C++ Source or Header  |  1998-09-09  |  1KB  |  54 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1998 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16. #ifdef DO_TAPEDECK_KIND    /* Support code */
  17.  
  18. VOID
  19. LTP_DrawBackFore(struct RastPort *RPort,BOOL Back,LONG Left,LONG Top,LONG Width,LONG Height)
  20. {
  21.     LONG i,Len,Start,ArrowWidth,ArrowHeight,Shift,x1,x2;
  22.  
  23.     ArrowWidth    = Width / 2;
  24.     ArrowHeight    = Height;
  25.     Left        = Left + (Width - ArrowWidth) / 2;
  26.     Shift        = ArrowWidth / 2;
  27.  
  28.     for(i = 0 ; i < ArrowWidth ; i++)
  29.     {
  30.         Len = ((ArrowHeight * (i + 1)) / ArrowWidth) & ~1;
  31.  
  32.         if(Len < ArrowHeight)
  33.             Len++;
  34.  
  35.         Start = Top + (ArrowHeight - Len) / 2;
  36.  
  37.         if(Back)
  38.         {
  39.             x1 = Left + i - Shift;
  40.             x2 = Left + i + Shift;
  41.         }
  42.         else
  43.         {
  44.             x1 = Left + ArrowWidth - 1 - i - Shift;
  45.             x2 = Left + ArrowWidth - 1 - i + Shift;
  46.         }
  47.  
  48.         LTP_DrawLine(RPort,x1,Start,x1,Start + Len - 1);
  49.         LTP_DrawLine(RPort,x2,Start,x2,Start + Len - 1);
  50.     }
  51. }
  52.  
  53. #endif    /* DO_TAPEDECK_KIND */
  54.